/*!
 * 域名搜索正在进行
 * v 1.0.0
 * Copyright © 2015 - Blue Shark. All Rights Reserved  
 * by: 酱油鲜 (871839012@qq.com)
 * since: 2015‎年‎8月‎20日  
 * 
 */




$(document).ready(function() {
	/**
	 * 提交cookie 
	 * 请求加载所有任务未完成列表
	 * 返回数据有 任务id  任务名称 
	 */
	var color=['#dbdbdb','#03a9f4','#1c1c1c','#0398db','#04b1ff'];//,'#FA6800','#00AFF0','#16499A','#CE352C','#128023','#0099FF','#339999','#CC3366','#000000'
	/**
	 *   #dbdbdb   #0398db  
#04b1ff 
#1c1c1c
#fc560b
#03a9f4 
	 */
	$.each($(".tile"), function(){
        var tile = $(this);
        var colors=color[Math.floor(Math.random()*color.length)];
        setTimeout(function(){
            tile.css({
                opacity: 1,
                "-webkit-transform": "scale(1)",
                "transform": "scale(1)",
                "-webkit-transition": ".3s",
                "transition": ".3s",
               // 'background-color':'#03a9f4'
            });
        }, Math.floor(Math.random()*500));
    });
	$("button[data-newTask]").click(function(e) {
		var str='<div class="tile double" data-role="tile">';
		str+='<input type="text" name="domainName" placeholder="请输入要搜索的域名" value=""/>';
		str+='<i class="icon-trash" title="删除"></i>';
		str+='</div>';
		var colors=color[Math.floor(Math.random()*color.length)];
		var $str=$(str).appendTo($(".tile-container")).addClass("new-task").css({
                opacity: 1,
                "-webkit-transform": "scale(1)",
                "transform": "scale(1)",
                "-webkit-transition": ".3s",
                "transition": ".3s",
                //'background-color':'#03a9f4'
            });
	});
	$(".icon-trash").click(function(e){
		$(this).closest(".tile").fadeOut(600,function(){
			$(this).remove();
		});
	});
	
});